﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace RiskMan.DataClass.AlfaDirectFolder
{
    /// <summary>
    /// ТАБЛИЦА «ORDER_TYPES» - СПРАВОЧНИК ТИПОВ ЗАЯВОК
    /// Ключевое поле: ord_type
    /// </summary>
    public class OrderTypes : INotifyPropertyChanged
    {
        #region Private

        private string _ordType;
        private string _desctiption;
        private int _iLastUpdate;

        #endregion

        #region Public

        /// <summary>
        /// Код типа заявки.
        /// </summary>
        public string OrdStatus
        {
            get { return _ordType; }
            set
            {
                if (_ordType != value)
                    _ordType = value;

                RaisePropertyChanged("OrdStatus");
            }
        }
        /// <summary>
        /// Описание типа заявки.
        /// </summary>
        public string Desctiption
        {
            get { return _desctiption; }
            set
            {
                if (_desctiption != value)
                    _desctiption = value;

                RaisePropertyChanged("Desctiption");
            }
        }
        /// <summary>
        /// Временная метка последнего обновления.
        /// </summary>
        public int ILastUpdate
        {
            get { return _iLastUpdate; }
            set
            {
                if (_iLastUpdate != value)
                    _iLastUpdate = value;

                RaisePropertyChanged("ILastUpdate");
            }
        }

        #endregion

        #region event PropertyChangedEventHandler

        public event PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName)
        {
            var handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion
    }
}
